package com.itboye.jinpuyiyuan.presenter;

import com.itboye.jinpuyiyuan.bean.BranchBean;
import com.itboye.jinpuyiyuan.interfaces.ISelectBranch;
import com.itboye.jinpuyiyuan.responsitory.BranchAddressResponsitory;
import com.itboye.jinpuyiyuan.utils.volley.BasePresenter;
import com.itboye.jinpuyiyuan.utils.volley.ICompleteListener;
import com.itboye.jinpuyiyuan.utils.volley.ResultEntity;

import java.util.Observer;

/**
 * Created by Administrator on 2017/12/14 0014.
 */

public class BranchAddressPresenter extends BasePresenter implements  ISelectBranch<BranchBean> {

    // 微信登录接口
    public static final String By_Weixin_loginApp_success = BranchAddressPresenter.class.getName()
            + "_By_Weixin_loginApp_success";
    public static final String By_Weixin_loginApp_fail = BranchAddressPresenter.class.getName()
            + "_By_Weixin_loginApp_fail";
    // 修改标签
    public static final String By_UserTags_edit_success = BranchAddressPresenter.class.getName()
            + "_By_UserTags_edit_success";

    public static final String By_UserTags_edit_fail = BranchAddressPresenter.class.getName()
            + "_By_UserTags_edit_fail";

    //添加标签
    public static final String By_UserTags_add_success = BranchAddressPresenter.class.getName()
            + "_By_UserTags_add_success";

    public static final String By_UserTags_add_fail = BranchAddressPresenter.class.getName()
            + "_By_UserTags_add_fail";

    // 删除标签
    public static final String By_UserTags_delete_success = BranchAddressPresenter.class.getName()
            + "_By_UserTags_delete_success";
    public static final String By_UserTags_delete_fail = BranchAddressPresenter.class.getName()
            + "_By_UserTags_delete_fail";
    // 查询标签
    public static final String By_UserTags_query_success = BranchAddressPresenter.class.getName()
            + "_By_Alibaichuan_sync_success";
    public static final String By_UserTags_query_fail = BranchAddressPresenter.class.getName()
            + "_By_Alibaichuan_sync_fail";

    // 同步用户信息(密码,头像)
    public static final String By_Alibaichuan_sync_success = BranchAddressPresenter.class.getName()
            + "_By_Alibaichuan_sync_success";
    public static final String By_Alibaichuan_sync_fail = BranchAddressPresenter.class.getName()
            + "_By_Alibaichuan_sync_fail";
    // 查询用户在线状态
    public static final String By_UserProfile_getOnlineStatus_success = BranchAddressPresenter.class.getName()
            + "_By_UserProfile_getOnlineStatus_success";
    public static final String By_UserProfile_getOnlineStatus_fail = BranchAddressPresenter.class.getName()
            + "_By_UserProfile_getOnlineStatus_fail";
    // 查询用户信息
    public static final String By_Alibaichuan_info_success = BranchAddressPresenter.class.getName()
            + "_By_Alibaichuan_info_success";
    public static final String By_Alibaichuan_info_fail = BranchAddressPresenter.class.getName()
            + "_By_Alibaichuan_info_fail";
    // 会员等级
    public static final String By_UserGrade_info_success = BranchAddressPresenter.class.getName()
            + "_By_UserGrade_info_success";
    public static final String By_UserGrade_info_fail = BranchAddressPresenter.class.getName()
            + "_By_UserGrade_info_fail";
    // 轮播
    public static final String By_Banners_query_success = BranchAddressPresenter.class.getName()
            + "_By_Banners_query_success";
    public static final String By_Banners_query_fail = BranchAddressPresenter.class.getName()
            + "_By_Banners_query_fail";

    // 获取配置
    public static final String config_success = BranchAddressPresenter.class.getName()
            + "_config_success";
    public static final String config_fail = BranchAddressPresenter.class.getName()
            + "_config_fail";
     //获取验证码

    public static final String By_SecurityCode_create_success = BranchAddressPresenter.class.getName()
            + "_config_success";
    public static final String By_SecurityCode_create_fail = BranchAddressPresenter.class.getName()
            + "_config_fail";
   //发送验证码

    public static final String By_SecurityCode_send_success = BranchAddressPresenter.class.getName()
            + "_By_SecurityCode_send_success";
    public static final String By_SecurityCode_send_fail = BranchAddressPresenter.class.getName()
            + "_By_SecurityCode_send_fail";

   //校验验证码
    public static final String By_SecurityCode_verify_success = BranchAddressPresenter.class.getName()
            + "_By_SecurityCode_verify_fail_success";
    public static final String By_SecurityCode_verify_fail = BranchAddressPresenter.class.getName()
            + "_By_SecurityCode_verify_fail_fail";

    //验证验证码

    public static final String By_SecurityCode_check_success = BranchAddressPresenter.class.getName()
            + "_By_SecurityCode_check_success";
    public static final String By_SecurityCode_check_fail = BranchAddressPresenter.class.getName()
            + "_By_SecurityCode_check_fail";

    // 修改密码（有验证码）
    public static final String By_UserAccount_updatePwdByMobile_success = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_loginByMobile_success";
    public static final String By_UserAccount_updatePwdByMobile_fail = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_loginByMobile_fail";
    // 修改密码（无验证码）
    public static final String By_UserAccount_updatePwdByOldPwd_success = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_updatePwdByOldPwd_success";
    public static final String By_UserAccount_updatePwdByOldPwd_fail = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_updatePwdByOldPwd_fail";
    // 注册
    public static final String By_UserAccount_register_success = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_register_success";
    public static final String By_UserAccount_register_fail = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_register_fail";
    // 登录
    public static final String By_UserAccount_loginByMobile_success = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_loginByMobile_success";
    public static final String By_UserAccount_loginByMobile_fail = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_loginByMobile_fail";


    // 退出登录
    public static final String By_UserAccount_logout_success = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_logout_success";
    public static final String By_UserAccount_logout_fail = BranchAddressPresenter.class.getName()
            + "_By_UserAccount_logout_fail";

    //消息查询
    public static final String By_Message_query_success = BranchAddressPresenter.class.getName()
            + "_By_Message_query_success";
    public static final String By_Message_query_fail = BranchAddressPresenter.class.getName()
            + "_By_Message_query_fail";
    //私聊消息
    public static final String By_Message_queryCallDetail_success= BranchAddressPresenter.class.getName()+
            "_By_Message_queryCallDetail_success";
    public static final String By_Message_queryCallDetail_fail= BranchAddressPresenter.class.getName()+
            "_By_Message_queryCallDetail_fail";
    //文章点赞
    public static final String By_Post_like_success = BranchAddressPresenter.class.getName()
            + "_By_Post_like_success";
    public static final String By_Post_like_fail = BranchAddressPresenter.class.getName()
            + "_By_Post_like_fail";


    //文章查询
    public static final String By_Post_queryByCateOrTag_success = BranchAddressPresenter.class.getName()
            + "_By_Post_queryByCateOrTag_success";
    public static final String By_Post_queryByCateOrTag_fail = BranchAddressPresenter.class.getName()
            + "_By_Post_queryByCateOrTag_fail";
    //文章详情
    public static final String By_Post_info_success = BranchAddressPresenter.class.getName()
            + "_By_Post_info_success";
    public static final String By_Post_info_fail = BranchAddressPresenter.class.getName()
            + "_By_Post_info_fail";
    // 意见反馈
    public static final String By_Suggest_add_success = BranchAddressPresenter.class.getName()
            + "_By_Suggest_add_success";
    public static final String By_Suggest_add_fail = BranchAddressPresenter.class.getName()
            + "_By_Suggest_add_fail";
    // 分院查询
    public static final String queryAddress_success = BranchAddressPresenter.class.getName()
            + "_queryAddress_success";
    public static final String queryAddress_fail = BranchAddressPresenter.class.getName()
            + "_queryAddress_fail";

    // 分院科室查询
    public static final String By_HospSect_query_success = BranchAddressPresenter.class.getName()
            + "_By_HospSect_query_success";
    public static final String By_HospSect_query_fail = BranchAddressPresenter.class.getName()
            + "_By_HospSect_query_fail";

    // 医师查询
    public static final String By_HospDoct_query_success = BranchAddressPresenter.class.getName()
            + "_By_HospDoct_query_success";
    public static final String By_HospDoct_query_fail = BranchAddressPresenter.class.getName()
            + "_By_HospDoct_query_fail";
    // 医师详情
    public static final String By_HospDoct_detail_success = BranchAddressPresenter.class.getName()
            + "_By_HospDoct_detail_success";
    public static final String By_HospDoct_detail_fail = BranchAddressPresenter.class.getName()
            + "_By_HospDoct_detail_fail";

    // 获取用户信息
    public static final String By_UserIdCard_info_success = BranchAddressPresenter.class.getName()
            + "_By_UserIdCard_info_success";
    public static final String By_UserIdCard_info_fail = BranchAddressPresenter.class.getName()
            + "_By_UserIdCard_info_fail";
    // 用户身份证姓名更新
    public static final String By_UserIdCard_update_success = BranchAddressPresenter.class.getName()
            + "_By_UserIdCard_update_success";
    public static final String By_UserIdCard_update_fail = BranchAddressPresenter.class.getName()
            + "_By_UserIdCard_update_fail";
    // 用户GPS更新
    public static final String By_UserProfile_updateGeoHash_success = BranchAddressPresenter.class.getName()
            + "_By_UserProfile_updateGeoHash_success";
    public static final String By_UserProfile_updateGeoHash_fail = BranchAddressPresenter.class.getName()
            + "_By_UserProfile_updateGeoHash_fail";
    // 用户更新
    public static final String By_UserProfile_update_success = BranchAddressPresenter.class.getName()
            + "_By_UserProfile_update_success";
    public static final String By_UserProfile_update_fail = BranchAddressPresenter.class.getName()
            + "_By_UserProfile_update_fail";

    //排班查询
    public static final String By_HospDoct_regInfo_success=BranchAddressPresenter.class.getName()
            + "_By_HospDoct_regInfo_success";
    public static final String By_HospDoct_regInfo_faile=BranchAddressPresenter.class.getName()
            + "_By_HospDoct_regInfo_faile";
   //预约挂号
    public static final String By_Order_orderReg_success=BranchAddressPresenter.class.getName()
           +"_By_Order_orderReg_success";
    public static final String By_Order_orderReg_faile=BranchAddressPresenter.class.getName()
            +"_By_Order_orderReg_faile";

    //获取支付信息
    public static final String By_Order_prePay_success=BranchAddressPresenter.class.getName()
            +"_By_Order_prePay_success";
    public static final String By_Order_prePay_faile=BranchAddressPresenter.class.getName()
            +"_By_Order_prePay_faile";

    //实名认证
    public static final String By_UserIdCard_verify_success=BranchAddressPresenter.class.getName()
            +"_By_UserIdCard_verify_success";
    public static final String By_UserIdCard_verify_fail=BranchAddressPresenter.class.getName()
            +"_By_UserIdCard_verify_fail";

    //订单列表
    public static final String By_Order_orderList_success=BranchAddressPresenter.class.getName()
            +"_By_Order_orderList_success";
    public static final String By_Order_orderList_fail=BranchAddressPresenter.class.getName()
            +"_By_Order_orderList_fail";

    //订单详情
    public static final String By_Order_orderDetail_success=BranchAddressPresenter.class.getName()
            +"_By_Order_orderDetail_success";
    public static final String By_Order_orderDetail_fail=BranchAddressPresenter.class.getName()
            +"_By_Order_orderDetail_fail";

    //取消挂号并退款
    public static final String By_Order_refund_success=BranchAddressPresenter.class.getName()
            +"_By_Order_refund_success";
    public static final String By_Order_refund_fail=BranchAddressPresenter.class.getName()
            +"_By_Order_refund_fail";

    //退款
    public static final String By_Order_OrderRefund_success=BranchAddressPresenter.class.getName()
            +"_By_Order_OrderRefund_success";
    public static final String By_Order_OrderRefund_fail=BranchAddressPresenter.class.getName()
            +"_By_Order_OrderRefund_fail";


    //住院信息
    public static final String By_Hospitalization_advanceGold_success=BranchAddressPresenter.class.getName()
            +"_BBy_Hospitalization_advanceGold_success";
    public static final String By_Hospitalization_advanceGold_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_advanceGold_fail";

    //日清单
    public static final String By_Hospitalization_dailyList_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_dailyList_success";
    public static final String By_Hospitalization_dailyList_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_dailyList_fail";

    //日清单详情
    public static final String By_Hospitalization_dailyDetail_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_dailyDetail_success";
    public static final String By_Hospitalization_dailyDetail_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_dailyDetail_fail";

    //获取体检套餐列表跟套餐详情
    public static final String By_Hospitalization_staticMenu_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_staticMenu_success";
    public static final String By_Hospitalization_staticMenu_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_staticMenu_fail";

    //获取自选套餐科室
    public static final String By_Hospitalization_deptList_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_deptList_success";
    public static final String By_Hospitalization_deptList_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_deptList_fail";


    //获取体检科室与项目关系
    public static final String By_Hospitalization_optionalMenu_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_optionalMenu_success";
    public static final String By_Hospitalization_optionalMenu_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_optionalMenu_fail";

    //体检预约预确认
    public static final String By_Hospitalization_appointment_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_appointment_success";
    public static final String By_Hospitalization_appointment_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_appointment_fail";

    //处方记录
    public static final String By_prescriptionRecord_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prescriptionRecord_success";

    public static final String By_prescriptionRecord_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prescriptionRecord_fail";

    //生成处方订单
    public static final String By_Hospitalization_prescriptionOrder_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prescriptionOrder_success";

    public static final String By_Hospitalization_prescriptionOrder_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prescriptionOrder_fail";

    //处方记录详情
    public static final String By_prescriptionDetail_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prescriptionDetail_success";

    public static final String By_prescriptionDetail_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prescriptionDetail_fail";

    //获取体检预约记录列表
    public static final String By_Hospitalization_getCheckList_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_getCheckList_success";

    public static final String By_Hospitalization_getCheckList_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_getCheckList_fail";

    //获取体检预约记录列表
    public static final String By_Hospitalization_getReport_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_getReport_success";

    public static final String By_Hospitalization_getReport_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_getReport_fail";



    //获取化验记录列表
    public static final String By_Hospitalization_laboratoryRecord_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_laboratoryRecord_success";

    public static final String By_Hospitalization_laboratoryRecord_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_laboratoryRecord_fail";

    //就诊记录
    public static final String By_Hospitalization_visitingRecord_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_visitingRecord_success";

    public static final String By_Hospitalization_visitingRecord_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_visitingRecord_fail";

    //获取化验详情
    public static final String By_Hospitalization_laboratoryDetail_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_laboratoryDetail_success";

    public static final String By_Hospitalization_laboratoryDetail_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_laboratoryDetail_fail";


    //获取住院记录列表
    public static final String By_Hospitalization_inHospital_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_inHospital_success";

    public static final String By_Hospitalization_inHospital_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_inHospital_fail";

    //预交金预支付
    public static final String By_Hospitalization_inHosPrePay_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_inHosPrePay_success";

    public static final String By_Hospitalization_inHosPrePay_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_inHosPrePay_fail";

    //预交金记录
    public static final String By_Hospitalization_prepayList_success=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prepayList_success";

    public static final String By_Hospitalization_prepayList_fail=BranchAddressPresenter.class.getName()
            +"_By_Hospitalization_prepayList_fail";
    public BranchAddressPresenter(Observer observer) {
        super(observer);
    }


    @Override
    public void deleteCacheConfig(String nope) {

    }

    @Override
    public void getConfig() {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(config_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(config_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                });
        branch.getConfig();
    }

    @Override
    public void queryBranch(String longitude, String latitude) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(queryAddress_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(queryAddress_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryBranch(longitude,latitude);
    }

    @Override
    public void queryDepartment(String hid ,String parent_id) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_HospSect_query_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_HospSect_query_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryDepartment(hid,parent_id);

    }


    @Override
    public void getVerifyCode(String accepter, int code_type, int code_length, int code_create_way, int expire_time) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_SecurityCode_create_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_SecurityCode_create_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getVerifyCode(accepter,code_type,code_length,code_create_way,expire_time);
    }

    @Override
    public void sendVerifyCode(String mobile, String code_type, String send_type) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_SecurityCode_send_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_SecurityCode_send_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.sendVerifyCode(mobile, code_type, send_type);
    }

    @Override
    public void verifyCode(String mobile, String code, String code_type) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_SecurityCode_verify_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_SecurityCode_verify_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.verifyCode(mobile, code, code_type);
    }

    @Override
    public void verificationVerifyCode(String accepter, String code, int code_type) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_SecurityCode_check_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_SecurityCode_check_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.verificationVerifyCode(accepter,code,code_type);
    }


    @Override
    public void updatePass(String uid, String password, String new_password) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserAccount_updatePwdByOldPwd_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserAccount_updatePwdByOldPwd_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.updatePass(uid, password, new_password);

    }

    @Override
    public void register(String username, String mobile, String code, String password) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserAccount_register_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserAccount_register_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.register(username,mobile,code,password);
    }

    @Override
    public void login(String nickname,String head,String wx_open_id,String wx_union_id,String mobile, String code, String password, String role) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserAccount_loginByMobile_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserAccount_loginByMobile_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.login(nickname, head, wx_open_id, wx_union_id, mobile, code, password, role);
    }

    @Override
    public void outLogin(String uid, String session_id) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserAccount_logout_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserAccount_logout_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.outLogin(uid,session_id);
    }

    @Override
    public void deleteUser(String uid) {

    }

    @Override
    public void forgetPassword(String mobile, String code, String password) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserAccount_updatePwdByMobile_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserAccount_updatePwdByMobile_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.forgetPassword(mobile,code,password);
    }

    @Override
    public void resetPassword(String uid, String password, String new_password) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserAccount_updatePwdByOldPwd_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserAccount_updatePwdByOldPwd_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.resetPassword(uid,password,new_password);
    }

    @Override
    public void suggestContent(String uid, String name, String suggest_content, String tel, String email,
                               String img_ids, String extra) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Suggest_add_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Suggest_add_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.suggestContent(uid,name,suggest_content,tel,email,img_ids,extra);

    }

    @Override
    public void getPersonInfo(String uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserIdCard_info_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserIdCard_info_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getPersonInfo(uid);
    }

    @Override
    public void updatePersonInfo(String uid, String card_no, String real_name) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserIdCard_update_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserIdCard_update_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.updatePersonInfo(uid, card_no, real_name);
    }

    @Override
    public void updateLocation(String uid, String lat, String lng, String coordinate_type) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserProfile_updateGeoHash_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserProfile_updateGeoHash_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.updateLocation(uid, lat, lng, coordinate_type);
    }

    @Override
    public void updateUserProfile(String uid, String nickname, String sign, int sex, String realname,
                                  String idnumber, int online_status) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserProfile_update_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserProfile_update_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.updateUserProfile(uid,nickname,sign,sex,realname,idnumber,online_status);
    }

    @Override
    public void queryDoctor(String hid, String cid,String dept_id,String page_index,String page_size,String kword) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_HospDoct_query_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_HospDoct_query_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryDoctor(hid,cid,dept_id,page_index,page_size,kword);
    }

    @Override
    public void queryDoctorDetail(String uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_HospDoct_detail_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_HospDoct_detail_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryDoctorDetail(uid);
    }

    @Override
    public void postLike(String id, String uid, int cancel) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Post_like_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Post_like_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.postLike(id,uid,cancel);
    }

    @Override
    public void articleDetail(String id,String uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Post_info_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Post_info_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.articleDetail(id,uid);
    }

    @Override
    public void addArticle(String category, String author, String author_name, String cover, String title, String excerpt, String content, String tags, String post_status, String parent_id, String jump_url, int views, String article_from, int likes) {

    }

    @Override
    public void updateArticle(String category, String author, String author_name, String cover, String title, String excerpt, String content, String tags, String post_status, String parent_id, String jump_url, int views, String article_from, int likes) {

    }

    @Override
    public void queryArticle(String category, String tags, String post_status,int page_index,int page_size) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Post_queryByCateOrTag_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Post_queryByCateOrTag_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryArticle(category,tags,post_status,page_index,page_size);
    }

    @Override
    public void deleteArticle(String id) {

    }

    @Override
    public void addMessage(String dtree_type, String title, String content, String summary, int send_time, String from_uid, String to_uid, String extra) {

    }

    @Override
    public void queryMessage(String uid, String msg_type, int page_index, int page_size) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Message_query_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Message_query_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryMessage(uid, msg_type, page_index, page_size);
    }

    @Override
    public void addPrivateMessage(String dtree_type, String content, String send_time, String from_uid, String to_uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Message_queryCallDetail_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Message_queryCallDetail_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.addPrivateMessage(dtree_type,content,send_time,from_uid,to_uid);
    }

    @Override
    public void queryBanner(String position) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Banners_query_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Banners_query_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryBanner(position);
    }

    @Override
    public void memberGrade(String uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserGrade_info_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserGrade_info_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.memberGrade(uid);
    }

    @Override
    public void queryRegion(String uid) {

    }

    @Override
    public void queryPersonInfo(String openId) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Alibaichuan_info_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Alibaichuan_info_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryPersonInfo(openId);
    }

    @Override
    public void synPersonInfo(String uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Alibaichuan_sync_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Alibaichuan_sync_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.synPersonInfo(uid);
    }

    @Override
    public void addRemark(String uid,String tag_name,String who_tag_uid ) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserTags_add_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserTags_add_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.addRemark(uid, tag_name, who_tag_uid);
    }

    @Override
    public void updateRemark(String id, String uid, String tag_name) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserTags_edit_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserTags_edit_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.updateRemark(id, uid, tag_name);

    }

    @Override
    public void removeRemark(int id) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserTags_delete_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserTags_delete_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.removeRemark(id);
    }

    @Override
    public void queryRemark(int uid) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserTags_query_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserTags_query_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryRemark(uid);
    }

    @Override
    public void queryOnlineStatus(String bc_open_id) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserProfile_getOnlineStatus_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserProfile_getOnlineStatus_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.queryOnlineStatus(bc_open_id);
    }

    @Override
    public void loginByWX(String role, String device_token, String auth_code) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Weixin_loginApp_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Weixin_loginApp_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.loginByWX(role, device_token, auth_code);
    }

    @Override
    public void doctorRegInfo(String dept_id, String doctor_id, String start, String end) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_HospDoct_regInfo_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_HospDoct_regInfo_faile);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.doctorRegInfo(dept_id,doctor_id,start,end);
    }

    @Override
    public void preRegistration(String uid, String reg_id, String reg_level, String dept_id, String doctor_id, String reg_date, String time_flag, String reg_fee, String treat_fee) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Order_orderReg_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Order_orderReg_faile);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.preRegistration(uid,reg_id,reg_level,dept_id,doctor_id,reg_date,time_flag,reg_fee,treat_fee);
    }

    @Override
    public void cancelOrderReg(String uid, String order_id, String cancel_remark) {

//        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
//                new ICompleteListener() {
//                    @Override
//                    public void success(ResultEntity result) {
//                        result.setEventTag(Tag_Success);
//                        result.setEventType(By_HospDoct_regInfo_success);
//                        BranchAddressPresenter.this.setChanged();
//                        BranchAddressPresenter.this.notifyObservers(result);
//                    }
//
//                    @Override
//                    public void failure(ResultEntity result) {
//                        result.setEventTag(Tag_Error);
//                        result.setEventType(By_HospDoct_regInfo_faile);
//                        BranchAddressPresenter.this.setChanged();
//                        BranchAddressPresenter.this.notifyObservers(result);
//
//                    }
//                });
//        branch.cancelOrderReg(uid,order_id,cancel_remark);
    }


    @Override
    public void getPayInfo(String uid, String order_id, String channel, String note) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Order_prePay_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Order_prePay_faile);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                });
        branch.getPayInfo(uid,order_id,channel,note);
    }

    @Override
    public void cancelOrderRefund(String uid, String order_id, String refund_remark, String refund_fee) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Order_refund_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Order_refund_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                });
        branch.cancelOrderRefund(uid, order_id, refund_remark, refund_fee);
    }

    @Override
    public void rebackMoney(String uid, String order_id) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Order_OrderRefund_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Order_OrderRefund_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }
                });
        branch.rebackMoney(uid,order_id);
    }

    @Override
    public void getOrderList(String uid, String order_type,String pay_status, String page, String size) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Order_orderList_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Order_orderList_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getOrderList(uid, order_type, pay_status, page, size);
    }

    @Override
    public void getOrderDetail(String uid, String order_id) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Order_orderDetail_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Order_orderDetail_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getOrderDetail(uid, order_id);
    }

    //实名认证
    @Override
    public void verifyUserIdCard(String uid, String card_no, String birthday, String real_name, String sex, String mobile, String verify_code, int front_img, int back_img) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_UserIdCard_verify_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_UserIdCard_verify_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.verifyUserIdCard(uid,card_no,birthday,real_name,sex,mobile,verify_code,front_img,back_img);
    }

    @Override
    public void HospitalInfo(String uid) {


        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_advanceGold_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_advanceGold_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.HospitalInfo(uid);
    }

    @Override
    public void dailyList(String uid) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_dailyList_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_dailyList_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.dailyList(uid);
    }

    @Override
    public void dailyInfo(String uid, String date) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_dailyDetail_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_dailyDetail_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.dailyInfo(uid,date);
    }

    @Override
    public void physicalList(String uid, String packageID, int page, int pageSize) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_staticMenu_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_staticMenu_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.physicalList(uid,packageID,page,pageSize);
    }

    @Override
    public void getSelfList(String uid) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_deptList_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_deptList_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getSelfList(uid);
    }

    @Override
    public void getPhysicals(String uid, String deptId) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_optionalMenu_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_optionalMenu_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getPhysicals(uid,deptId);
    }

    @Override
    public void physicalOrder(String uid, String isMenu, String menuId, String itemData, String fee, String checkDate) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_appointment_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_appointment_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.physicalOrder(uid,isMenu,menuId,itemData,fee,checkDate);

    }

    @Override
    public void recipeRecord(String uid, String query_type) {
        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_prescriptionRecord_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_prescriptionRecord_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.recipeRecord(uid,query_type);
    }

    @Override
    public void recipeRecordInfo(String uid, String hosp_sequence) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_prescriptionDetail_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_prescriptionDetail_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.recipeRecordInfo(uid,hosp_sequence);
    }


    @Override
    public void recipeOrder(String uid, String hosp_sequence) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_prescriptionOrder_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_prescriptionOrder_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.recipeOrder(uid,hosp_sequence);
    }

    @Override
    public void getPhyAppoint(String uid) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_getCheckList_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_getCheckList_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getPhyAppoint(uid);
    }

    @Override
    public void getReporter(String uid, String checkUpId) {


        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_getReport_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_getReport_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getReporter(uid,checkUpId);
    }

    @Override
    public void getHospRecord(String uid) {


        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_visitingRecord_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_visitingRecord_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getHospRecord(uid);
    }

    @Override
    public void getLaborRecord(String uid) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_laboratoryRecord_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_laboratoryRecord_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getLaborRecord(uid);
    }

    @Override
    public void getLaborInfo(String uid, String report_type, String report_id) {


        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_laboratoryDetail_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_laboratoryDetail_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getLaborInfo(uid,report_type,report_id);
    }

    @Override
    public void getInHosRecord(String uid) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_inHospital_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_inHospital_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getInHosRecord(uid);
    }

    @Override
    public void getYJJPay(String uid, String fee) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_inHosPrePay_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_inHosPrePay_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getYJJPay(uid,fee);
    }

    @Override
    public void getYjjRecord(String uid, String patientId, String inDate) {

        ISelectBranch<BranchBean> branch = new BranchAddressResponsitory(
                new ICompleteListener() {
                    @Override
                    public void success(ResultEntity result) {
                        result.setEventTag(Tag_Success);
                        result.setEventType(By_Hospitalization_prepayList_success);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);
                    }

                    @Override
                    public void failure(ResultEntity result) {
                        result.setEventTag(Tag_Error);
                        result.setEventType(By_Hospitalization_prepayList_fail);
                        BranchAddressPresenter.this.setChanged();
                        BranchAddressPresenter.this.notifyObservers(result);

                    }
                });
        branch.getYjjRecord(uid,patientId,inDate);
    }


}
